home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PPC1B3AA.ZIP / UNIX2DOS.PPS < prev    next >
Text File  |  1996-08-29  |  978b  |  38 lines

  1. ;----------------------------------------------------------------------------
  2. ; Copyright(C) 1996, The AEGiS Corporation
  3. ;----------------------------------------------------------------------------
  4. ;
  5. ; FUNCTION UnixToDos()
  6. ;
  7. ; Convert a UNIX date (count of seconds since midnight 01/01/70) to a
  8. ; DOS date (Date & Time)
  9. ;
  10. ;----------------------------------------------------------------------------
  11. #lib
  12. #nouser
  13.  
  14. Declare Procedure UnixToDos(unsigned DateVal, Var Date NewDate, Var Time NewTime)
  15.  
  16. ;----------------------------------------------------------------------------
  17. ; UNIX Date&time -> DOSdate&time
  18. ;
  19. Procedure UnixToDos(unsigned DateVal, Var Date NewDate, Var Time NewTime)
  20. int tyear
  21. int tday
  22. int thour
  23. int tminute
  24. int tmonth
  25. unsigned tsecond
  26.  
  27. tsecond = DateVal % 86400
  28. DateVal = DateVal / 86400
  29.  
  30. tyear = (DateVal / 365)+2
  31.  
  32. tday = DateVal % 365 - tyear/4
  33. inc tday
  34.  
  35. NewDate = tday + (tyear+68) * 365 + 17
  36. NewTime = tsecond
  37. EndProc
  38.